﻿<!doctype html>
<html>
<head>
    <title></title>
    <!--<script type="text/javascript" src="../Scripts/config.js"></script>-->
    <script type="text/javascript" src="../WF/Scripts/jquery/jquery.min.js"></script>
    <script src="../WF/Scripts/QueryString.js" type="text/javascript"></script>

      <!-- 引入新版本的类库. -->
    <script src="../../WF/Scripts/config.js" type="text/javascript"></script>
    <script src="../../WF/Comm/Gener.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript">

        //页面启动函数.
        $(function () {

            var empNo = GetQueryString("EmpNo");

            if (empNo == null) {

                var webUser = new WebUser();
                empNo = webUser.No;
            }


            var img = document.getElementById("sigimg");

            var url = '/DataUser/Siganture/' + empNo + '.jpg';
            img.src = url;

        });

        function Upload() {

            var empNo = GetQueryString("EmpNo");

            Handler = "../WF/Setting/Handler.ashx";
            var url = Handler + "?DoType=Siganture_Save&EmpNo=" + empNo;
            var xhr = new XMLHttpRequest();
            xhr.open('post', url, true);
            var formData = new FormData();
            formData.append('file', myfile.files[0]);
            xhr.send(formData);

            //上传结束回掉函数
            xhr.onload = function () {

                if (this.responseText.indexOf('err@') == 0) {
                    alert(responseText);
                    return;
                }
                alert(this.responseText);
                window.location.href = window.location.href;
                //location.reload();
            }
        }
    </script>

</head>
<body>
        <h3>&nbsp;电子签名设置&nbsp;</h3>
        <hr />
        <p align="center">
            <img id="sigimg"  width="120" height="30"   border="1" onerror="this.src='../../DataUser/Siganture/UnName.jpg'" />
        </p>
        上传<input type="file" name="myfile" id="myfile" />
            <input id="btn" type="button" value="确定" onclick="Upload()" /></br></br>

        <b>利用扫描仪设置步骤:</b>
        <ul>
            <li>在白纸上写下您的签名</li>
            <li>送入扫描仪扫描，并得到jpg文件。</li>
            <li>利用图片处理工具把他们处理缩小到 90*30像素大小。</li>
        </ul>
        <b>手写设置:</b>
        <ul>
            <li>启动画板程序，写下您的签名。</li>
            <li>保存成.jpg文件，设置文件为90*30像素大小。</li>
        </ul>
        <!--<B>让系统自动为您创建（请选择字体）:</B><ul><li><a href='Siganture.htm?RefNo=Siganture&DoType=ST'>宋体</a></li> -->
        <!--<li><a href='Siganture.htm?RefNo=Siganture&DoType=LS'>隶书</a></li> 	-->

     
</body>
</html>
